/* book.chapter.uuid */
var contentId:String;		// checked
/* book.chapter.content */
var content:String;		// checked
/* TxtReader.settings */
var readerSettings:Object=new Object();		// checked
/* Microphone.settings */
var micSettings:Object;		// checked
/* flv.audioUUId */
var audioId:String;		// checked
/* mp3.audioUUId */
var filteredAudioId:String;
/* flv.audioId in repo and db */
var flvAudioId:String;
/* syncId in repo and db */
var syncId:String;
/* Recording Process Data - duration, timestamp */
var processData:Object=new Object();

// var username:String;

// collab section
/* collab members */
var userList:Array=new Array();
// var audioList:Array=new Array();
var host:Boolean;
var speakerHolder:String;
/* collab member info string 
Factor: name, id, recordingTime, different turn...
*/
var collabMembers:String;

// Task.Context
/* current task object
Result:
	[DEBUG]: publishedAudioId: 2
	[DEBUG]: chapter.chapterId: 2
	[DEBUG]: recordTaskId: 2
	[DEBUG]: recordAlbum.recordAlbumId: 1
	[DEBUG]: status: 1
	[DEBUG]: updateTime: 2008-09-30 21:43:17.0
	[DEBUG]: latestAudioId: 2
	[DEBUG]: createTime: 2008-09-30 21:43:29.0
*/
var currentTask:Object;
/* latest audio object
Request:
	Packages.modula.RequestCommand.request("HTTP", "restlet/audio/"+task.latestAudioId, null, null, null, this, data);
Result:
	[DEBUG]: flvAudioId: 32
	[DEBUG]: rating: 0
	[DEBUG]: uuid: 0c69400d-6b9e-4a97-845e-4ef7070e80a6
	[DEBUG]: memberId: 1
	[DEBUG]: name: mp3 source file
	[DEBUG]: subtype: 1
	[DEBUG]: sync.syncId: 32
	[DEBUG]: collabMemberIds: 
	[DEBUG]: ratingTotal: 0
	[DEBUG]: type: 1
	[DEBUG]: audioId: 33
	[DEBUG]: ratingCount: 0
	[DEBUG]: createTime: 2008-11-12 11:34:25.0
	[DEBUG]: recordTask.recordTaskId: 40
	[DEBUG]: sync.uuid: 19d6eef4-9393-4fb0-b40e-b0861e326f2d
*/
var latestAudio:Object;
/* latest sync file object 
Result:
	duration
	point
	block
*/
var latestSyncFile:Object;

function clear()
{
	// delete contentId;
	// delete content;
	// delete readerSettings;
	// delete micSettings;
	delete audioId;
	delete filteredAudioId;
	delete syncId;
	delete flvAudioId;
	delete processData;
	processData=new Object();
	delete userList;
	userList=new Array();
	// delete currentTask;
	delete latestAudio;
	delete latestSyncFile;
}

/*function dataProvider():Object
{
	var args=new Array();
	args.push(userList);
	var item=Packages.system.Collab.wrapInfo(this, "updateList", args);
	return item;
}*/

function updateList(nameList:Array)
{
	userList=nameList;
	Packages.log(Packages.model.UserProfile.data.nickName+".updateList: "+userList);
	var hostName=userList[userList.length-1];
	if (hostName==Packages.model.UserProfile.data.nickName)
	{
		host=true;
	}
	else host=false;
	collabMembers=userList.join(";");
}

function accessList()
{
	return userList;
}

/*function reportAudioId()
{
	var args:Array=new Array();
	args.push(username);
	args.push(audioId);
	Packages.system.Collab.updateInfo(this, "acceptAudioId", args);
}

function acceptAudioId(username:String, audioId:String)
{
	trace("acceptAudioId: "+username+" "+audioId);
	audioList[username]=audioId;
}

function AudioDataProvider()
{
	var args=new Array();
	args.push(audioList);
	var item=Packages.system.Collab.wrapInfo(this, "updateAudioList", args);
	return item;
}

function updateAudioList(audioArr)
{
	audioList=audioArr;
}*/